

<script type="text/javascript">
    //树表格
    $(function () {
        $('#list').datagrid({
            url          : '<?=site_url("admin/admin/getLogList");?>?d=d',
            idField      : 'id',
            fitColumns   : true,
            title:'管理员日志',
            collapseAll  : true,
            singleSelect : true,
            fit          : true,
            doSize       : true,
            closable     : true,
            striped      : true,
            rownumbers   : true,
            pagination:true,
            pagePosition:'top',
            pageSize:20,
            pageList:[10,20,30,40,50],
            toolbar      : $("#toolbal"),
            onDblClickRow: function () {
                showDialog("修改");
            },
            //checkbox     : true,
            frozenColumns: [[
                {field: 'id', title: 'ID'},
            ]],
            columns      : [[
                {fiele: 'info', title: '基本信息', colspan: 12, align: 'center'},
                {
                    field    : 'option',
                    title    : '操作',
                    rowspan  : 2,
                    align    : 'center',
                    formatter: function (value, row, index) {

                            return "<span onclick='edit(" + row.id + ")' >编辑</span> | <span onclick='del(" + row.id + ")'>删除</span>";
                    }
                }
            ], [
                {field: 'admin_id', title: '管理员ID'},
                {field: 'admin_name', title: '管理员名'},
                {
                    field: 'status',
                    title: '状态',
                    formatter: function (value, row, index) {
                        if (value == 1)return "<span style='color:darkgreen;'>成功</span>";
                        else return "<span style='color:red;'>失败</span>";
                    }
                },
                {field: 'option_directory', title: '目录'},
                {field: 'option_controller', title: '控制器'},
                {field: 'option_method', title: '方法'},
                {field: 'option_url', title: '链接'},
                {field: 'option_get', title: 'GET数据',width:200},
                {field:'option_post', title: 'POST数据'},
                {field:'option_time', title: '操作时间'},
                {field:'option_ip', title: '操作IP'},
                {field:'desc', title: '描述'},

            ]]
        });


    })

    //删除
    function del(obj) {

        $.messager.confirm("删除日志", "你确定删除选中日志?", function (r) {
            if (!r) return;
            $.post(
                "<?=site_url('admin/admin/deleteAdminLog');?>",
                {id:obj},
                function (data) {
                    if(data.isok)
                    {
                        $.messager.show({msg:'操作成功!', style:{}});
                        $("#list").datagrid('reload');
                    }
                    else
                    {
                        $.messager.show({msg:data.error, style:{}});
                    }

                },
                'json'
            );
        });
    }


</script>
<div id="toolbal" style="padding: 5px;">

    <form style="padding:5px;display: inline;">

         时间: <input class="easyui-datebox j_datebox" name="starttime" value="">
         文章: <input class="easyui-validatebox textbox" type="text" name="orderinfo_goodssn" value="">
         类型: <input class="easyui-validatebox textbox" type="text" name="orderinfo_orderinfosn" value="">
         <a id="j_finish_so" href="#" class="easyui-linkbutton" iconCls="icon-search">条件搜索</a>
         <a id="j_finish_clear" href="#" class="easyui-linkbutton" iconCls="icon-search">清空条件</a>
     </form>

     <span onclick="showDialog('添加')" class="easyui-linkbutton" data-options="iconCls:'icon-add'">添加</span>
     <span style="margin-right: 10px;" onclick="window.location.reload();" class="easyui-linkbutton" data-options="iconCls:'icon-reload'">刷新本页面</span>

</div>
<ul id="list"></ul>

<form id="form">
    <input name="id" type="hidden">
    <table>
        <tr>
            <td align="right">名　　称：</td>
            <td><input class="easyui-textbox" name="name" required="true"/></td>
        </tr>
        <tr>
            <td align="right">密　　码：</td>
            <td><input type="password" class="easyui-textbox" name="password"/></td>
        </tr>
        <tr>
            <td align="right">手　　机：</td>
            <td><input name="mobile" class="easyui-textbox"/></td>
            <td></td>
        </tr>
        <tr>
            <td align="right">邮　　箱：</td>
            <td><input name="email" class="easyui-textbox"/></td>
            <td></td>
        </tr>
        <tr>
            <td align="right">状　　态：</td>
            <td>
                <select name="status" class="easyui-combobox" required="true">
                    <option value="0">禁用</option>
                    <option value='1'>可用</option>
                </select>
            </td>
            <td></td>
        </tr>

    </table>

</form>
<ul id="tree"></ul>


